home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / ImageWriterLQ (alt. rdip) / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1995-04-10  |  7.6 KB  |  290 lines  |  [TEXT/MPS ]

  1. /* ------------------------------------------------------------------------------
  2. FILENAME
  3.     ChooserSupport.r
  4.  
  5. DESCRIPTION
  6.     This module contains the ImageWriter LQ constants, types, and resources that
  7.     are needed in order for the driver to work with the Chooser.
  8.             
  9.     Note: all resources should be designated to load into the system heap.
  10.  
  11. COPYRIGHT
  12.      Copyright Apple Computer, Inc. 1992-1994
  13.      All rights reserved. 
  14.     
  15.     12/20/93 - dmh - Sync'd with the shipping 1.0b3 GX driver.
  16.      8/28/94 - dmh - Sync'd with the shipping 1.0.1 GX driver.
  17.  
  18. -------------------------------------------------------------------------------- */
  19.  
  20. // System 7.0 Compatible
  21. #define SystemSevenOrLater        1
  22.  
  23. // Include System Resource Definitions
  24. #include "Types.r"
  25. #include "SysTypes.r"
  26.  
  27. // Include the ImageWriter LQ driver constants that are used in the resources 
  28. #include "Resources.h"
  29.  
  30. // Include the public QuickDraw GX printing files 
  31. #include "PrintingResTypes.r"
  32.  
  33. // Include the ImageWriter LQ Driver's LDEF and PACK Code Segments ===== */
  34.  
  35. include "IWLQ_PACK";
  36. include "IWLQ_LDEF";
  37.  
  38.  
  39. /*********************************************************************************************
  40.      THINGS TO CONTROL THE DEFAULT CHOOSING MECHANSIM
  41. *********************************************************************************************/
  42.  
  43. // The 'look' resource is used by the driver's PACK to know how to communicate 
  44. // to the device.  This resource contains the default settings, as the actual value 
  45. // can be found in the desktop printer. 
  46.  
  47. resource 'look' (kLookRsrcID, sysheap, purgeable) 
  48. {
  49.     2,                                    // use the first in our list by default
  50.     {
  51.         "AppleTalk",    kPAPCommRsrcID,                isAppleTalk,                        "LQ";
  52.         "Serial",        kSerialCommRsrcID,            iconCells,                            "Modem Port";
  53.         "Servers",        kPrinterShareCommRsrcID,    isAppleTalk+isPrinterShare,    "ImageWriterLQIS";
  54.     };
  55. };
  56.  
  57.  
  58. // This 'comm' resource defines the default communication settings when using this 
  59. // driver with PrinterShare. 
  60.  
  61. resource 'comm' (kPrinterShareCommRsrcID, sysheap, purgeable)
  62. {
  63.     PrinterShare
  64.     {
  65.         "",
  66.         0
  67.     };
  68. };
  69.  
  70.  
  71. // This 'comm' resource defines the default communication settings when using this 
  72. // driver with PAP communications. 
  73.  
  74. resource 'comm' (kPAPCommRsrcID, sysheap, purgeable) 
  75. {
  76.     PAP
  77.     {
  78.         1,
  79.         "",
  80.         0, 0, 0, 0
  81.     };
  82. };
  83.  
  84.  
  85. // This 'comm' resource defines the default communication settings when using this 
  86. // driver with direct Serial communications. 
  87.  
  88. resource 'comm' (kSerialCommRsrcID, sysheap, purgeable)
  89. {
  90.     Serial
  91.     {
  92.         baud19200,        /* Output baud rate */
  93.         noParity,        /* Output parity */
  94.         oneStop,            /* Output stop bits */
  95.         data8,            /* Output data size */
  96.         0x00010000,        /* Output handshaking (hardware handshaking) */
  97.         0x00000000,
  98.         baud19200,        /* Input baud rate */
  99.         noParity,        /* Input parity */
  100.         oneStop,            /* Input stop bits */
  101.         data8,            /* Input data bits */
  102.         0,                    /* Input handshaking */
  103.         0,
  104.         1024,                /* Input buffer size */
  105.         ".AIn",            /* Input driver name */
  106.         ".AOut"            /* Output driver name */
  107.     };
  108. };
  109.     
  110.  
  111. /*********************************************************************************************
  112.     STANDARD CHOOSER PACK STUFF
  113. *********************************************************************************************/
  114.  
  115.  
  116. // NBP Lookup type (maxed out so resource file won't need updating)
  117. resource 'STR ' (-4096, sysheap, purgeable)
  118. {
  119.     "XXXXXXXXXXXXXXXXXXXXXX";
  120. };
  121.  
  122. // NBP timeout value
  123. type 'GNRL'
  124. {
  125.     byte;    // timeout
  126.     byte;    // retries
  127. };
  128.  
  129. resource 'GNRL' (-4096, sysheap, purgeable)
  130. {
  131.     11,
  132.     5
  133. };
  134.  
  135. // title string (we'll put a control here, so we don't want a title)
  136. resource 'STR ' (-4091, sysheap, purgeable)
  137. {
  138.     "";
  139. };
  140.  
  141. // "left" button title
  142. resource 'STR ' (-4093)
  143. {
  144.     "Create";
  145. };
  146.  
  147. // rectangle list
  148. resource 'nrct' (-4096, sysheap, purgeable) {
  149.     {
  150.     {112, 251, 132, 311};            // left button
  151.     {0,0,0,0};                            // right button
  152.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  153.     {0,0,0,0};                            // off button
  154.     {0,0,0,0};                            // button label
  155.     };
  156. };
  157.  
  158. // Menu used to select between direct connect, AppleTalk, and Servers
  159. resource 'MENU' (-4096, sysheap, purgeable)
  160. {
  161.     -4096,
  162.     textMenuProc,
  163.     0xFFFFFFFF,    
  164.     enabled,
  165.     "",
  166.     {
  167.     }
  168. };
  169.  
  170. // Pop-up control used to select between direct connect printers and those being shared on the network
  171. resource 'CNTL' (-4096, sysheap, purgeable)
  172. {
  173.     {0, 0, 20, 213},                            // zero based control location
  174.     0,                                                // Title options 0 = Left justified
  175.     visible,                                        // Should we display the control?
  176.     95,                                            // Title Width
  177.     -4096,                                        // 'MENU' to display
  178.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  179.     0,                                             // refCon = ResType to append = None
  180.     "Connect via:"                                // Control title
  181. };
  182.  
  183. resource 'DITL' (-4096, sysheap, purgeable) 
  184. {
  185.     {
  186.         {3, 238, 23, 238 + 213}, 
  187.             Control {enabled, -4096},
  188.     };
  189. };
  190.  
  191.  
  192. resource 'DITL' (-4095, sysheap, purgeable) {
  193.     {    /* array DITLarray: 2 elements */
  194.         /* [1] */
  195.         {143, 310, 163, 368},
  196.         Button {
  197.             enabled,
  198.             "OK"
  199.         },
  200.         /* [2] */
  201.         {23, 87, 119, 377},
  202.         StaticText {
  203.             disabled,
  204.             "This printer driver could not be used.\n\n"
  205.             "Quitting one or more applications and then "
  206.             "trying again may allow you to use this "
  207.             "printer driver."
  208.         }
  209.     }
  210. };
  211.  
  212. resource 'ALRT' (-4095, sysheap, purgeable) {
  213.     {30, 30, 30+175, 30+380},
  214.     -4095,
  215.     {    /* array: 4 elements */
  216.         /* [1] */
  217.         OK, visible, sound1,
  218.         /* [2] */
  219.         OK, visible, sound1,
  220.         /* [3] */
  221.         OK, visible, sound1,
  222.         /* [4] */
  223.         OK, visible, sound1
  224.     },
  225.     alertPositionParentWindowScreen
  226. };
  227.  
  228. //-----------------------------------------------------------------------------------
  229. // CHOOSER PACK HELP RESOURCES
  230. //-----------------------------------------------------------------------------------
  231.  
  232.  
  233. /*    Any Chooser package can get balloons on all items that are normally 
  234.     added to the Chooser dialog by containing a STR# resource of 
  235.     resource ID = PackResID (-5694) and following the convention below:
  236.         
  237.         resource 'STR#' (-5694, sysheap, purgeable) {
  238.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  239.                 "kDisabledLeftButton";    // message for the control that is Disabled
  240.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  241.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  242.                 "kEnabledRightButton";
  243.                 "kDisabledRightButton";
  244.                 "kCheckedRightButton";
  245.                 "kOtherRightButton";
  246.                 "kEnabledOnButton";
  247.                 "kDisabledOnButton";
  248.                 "kCheckedOnButton";
  249.                 "kOtherOnButton";
  250.                 "kEnabledOffButton";
  251.                 "kDisabledOffButton";
  252.                 "kCheckedOffButton";
  253.                 "kOtherOffButton";
  254.                 "kEnabledOnOffTitle";
  255.                 "kDisabledOnOffTitle";
  256.                 "kCheckedOnOffTitle";
  257.                 "kOtherOnOffTitle";
  258.           }
  259.         };
  260.         
  261.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  262. */
  263.  
  264. resource 'STR#' (-5694, sysheap, purgeable) {
  265.   {        
  266.   
  267.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  268.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  269.         "";    // message for the control that is Checked (ie CtrlValue>0)
  270.         "";    // message for the control that is Other (ie CtrlValue>1)
  271.         "";    // kEnabledRightButton
  272.         "";    // kDisabledRightButton
  273.         "";    // kCheckedRightButton
  274.         "";    // kOtherRightButton
  275.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  276.         "";    // kDisabledOnButton
  277.         "";    // kCheckedOnButton 
  278.         "";    // kOtherOnButton
  279.         "";    // kEnabledOffButton
  280.         "";    // kDisabledOffButton
  281.         "";    // kCheckedOffButton
  282.         "";    // kOtherOffButton
  283.         "";    // kEnabledOnOffTitle
  284.         "";    // kDisabledOnOffTitle
  285.         "";    // kCheckedOnOffTitle
  286.         "";    // kOtherOnOffTitle
  287.   }
  288. };
  289.  
  290.